package com.zan.pattern.visitor.extend.test1;

/**
 * @Author Zan
 * @Create 2024/4/27 20:05
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Client
 */
class Animal {
    public void execute() {
        System.out.println("Animal");
    }
}

class Dog extends Animal {
    @Override
    public void execute() {
        System.out.println("dog");
    }
}

class Cat extends Animal {
    @Override
    public void execute() {
        System.out.println("cat");
    }
}

public class Client {
    public static void main(String[] args) {
        Animal a = new Dog();
        a.execute();

        Animal a1 = new Cat();
        a1.execute();
    }
}
